package com.whiteape.book.utils;

import org.greenrobot.greendao.converter.PropertyConverter;

import java.util.HashMap;
import java.util.Map;

public class MapConverter implements PropertyConverter<HashMap<String, String>, String> {
        @Override
        public HashMap<String, String> convertToEntityProperty(String databaseValue) {
            return GsonUtils.string2HashMaps(databaseValue);
        }

        @Override
        public String convertToDatabaseValue(HashMap entityProperty) {
            return GsonUtils.obj2String(entityProperty);
        }
    }